#ifndef __UEQ_FIFO_H_INCLUDED__
#define __UEQ_FIFO_H_INCLUDED__

#include "ueq_platform.h"

typedef struct UeqFifoStruct
{
    /* maximum number of elements */
    INT32   size;
    /* index of the first element */
    INT32   start;
    /* index at which to write new element  */
    INT32   end;
    /* memory buffer that holds the elements */
    BYTE   *buffer;
    /* is size a power of 2 */
    BOOL    size_is_pow_of_2;
} UeqFifo;

void ueq_fifo_init(UeqFifo *, BYTE *, INT32);
void ueq_fifo_reset(UeqFifo *);
BOOL ueq_fifo_is_full(UeqFifo *);
BOOL ueq_fifo_is_empty(UeqFifo *);
void ueq_fifo_push_back(UeqFifo *, BYTE);
BYTE ueq_fifo_pop_front(UeqFifo *);
BOOL ueq_fifo_write(UeqFifo *, BYTE*, INT32);
BOOL ueq_fifo_read(UeqFifo *, BYTE*, INT32);

#endif /* __UEQ_FIFO_H_INCLUDED__ */
